package daily.jun0605;

interface Cook{
    void makeFood();
}
public class CookLambdaTest {
    public static void invokeCook(Cook cooker){
        cooker.makeFood();
    }
    public static void main(String[] args) {
        //匿名内部类实现
        invokeCook(new Cook() {
            @Override
            public void makeFood() {
                System.out.println("匿名内部类：开饭咯~");
            }
        });
        //Lambda表达式实现
        invokeCook(()-> System.out.println("Lambda表达式：开饭咯~"));
    }
}
